#include "common.utils.hpp"


void test_image()
{
    SDL_Init(INIT_ALL);
    IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG);

    SDL_Window *window = SDL_CreateWindow(NAME, POS, POS, 2335, 1150, SHOW);

    SDL_Renderer *renderer = SDL_CreateRenderer(CREATERENDERER);

    // FIXED(etcix): copy sdl2_image.dll sdl2_*.dll to DllFiles;
    SDL_Surface *surface_backgroud = IMG_Load("Resources/Imgs/bios.png");
    SDL_Texture *texture_backgroud = SDL_CreateTextureFromSurface(renderer, surface_backgroud);

    SDL_Rect rect_backgroud = {.x=0,.y=0};
    SDL_QueryTexture(texture_backgroud, NULL, NULL, &rect_backgroud.w,&rect_backgroud.h);
    SDL_RenderCopy(renderer, texture_backgroud, NULL, &rect_backgroud);
    Present(renderer);
    DELAY(3000);


    SDL_DestroyTexture(texture_backgroud);
    SDL_FreeSurface(surface_backgroud);

    SDL_DestroyRenderer(renderer);

    SDL_DestroyWindow(window);

    IMG_Quit();
    SDL_Quit();

}